<template>
	<div>
		<div class="content" v-show="xianshi">
			<router-link to="/jifenguize">
				<div class="jifen">
					<div class="jifenkab"></div>
					<span class="jfgz_text">积分规则</span><span class="you_jh"><img src="static/arrow_right_gray.png"></span>
					<div class="clearfix"></div>
				</div>
			</router-link>
			<div style="height: 8px;background: #F5F5F5;"></div>
		<!--<div style="border-top: 8px solid #c0c0c0;"></div>-->

			<div class="dakuang" v-for="value in list">
				<div class="jfsc1">{{value.content}}</div>
				<div class="sj">{{value.addtime | datatime}}</div>
				<div :class="value.claname">{{value.zhangtai}}{{value.money}}</div>
				<div class="clearfix"></div>
			</div>
			<p class="clearfix"></p>
		</div>
		<div style="width: 100%;padding-top:50px;" v-show="!xianshi">
			<p style="font-size: 14px;text-align: center;">暂无信息</p>
		</div>
		<loading :show="show1" :text="text1"></loading>
  </div>
</template>

<script>
//import { Group, Cell } from 'vux'
import axios from 'axios'
import { mapState, mapActions } from 'vuex'
export default {
	components: {

	},
	data () {
		return {
			list:'',
			xianshi:true,
			show1:false,
			text1:'Loading...'
		}
	},
	created(){
		this.show1 = true;
		var that = this;
		axios.post(that.url+"/home/User/jifendetail",{openid:this.token})
        .then(function(res){
            console.log(res);
            that.show1 = false; 
            if(res.data.goods_duihuan.length <0){
            	that.xianshi = false;
            }else{
            	that.xianshi = true;
	            for(var i=0;i<res.data.goods_duihuan.length;i++){
	            	if(res.data.goods_duihuan[i].status == 0){
	            		res.data.goods_duihuan[i].claname = 'shuzi2';
	            		res.data.goods_duihuan[i].zhangtai = '+'
	            	}else{
	            		res.data.goods_duihuan[i].claname = 'shuzi1';
	            		res.data.goods_duihuan[i].zhangtai = '-'
	            	}
	            }
	            that.list = res.data.goods_duihuan;
	        }
        })
        .catch(function(err){
            console.log(err);
        })
	},
	computed:{
        ...mapState({
            token: state => state.Token.userToken()//获取用户Token
        }),
    }
}
</script>

<style>
	
.jifen{
		padding: 0 16px;
		width: 100%;
		height: 40px;
		background: white;
		/*background: url(../assets/img/question.png) no-repeat  center;margin-left: 10px;*/
		background-size: 20px;
	}
.jifenkab{
		margin-left:15px;
		float: left;
		height: 40px;
		}
		.you_jh{
			float: right;
			margin-top: 14px;
		}
		.you_jh img{
			display: block;
			width: 100%;
		}
		.jfgz_text{
			line-height: 20px;
			float: left;
			font-size: 14px;
			margin-top: 10px;
			color: #333;
			margin-left: -15px;
		}
	.jifenk img{
		display: block;
		width: 100%;
	}
.dakuang{background: white;
		border: 1px /*solid*/ red;
		width: 100%;
		height: 50px;
		border-bottom: 1px solid #EEEEEE;
		padding: 12px 15px;
		
		
	}
.jfsc1{line-height: 15px;
		font-size: 15px;
		color: #333333;
		border: 1px /*solid */red;
		
	}
.sj{
		line-height: 12px;
		font-size: 12px;
		color: #9B9B9B;
		margin-top: 3px;
	}
.shuzi1{
		float: right;
		line-height: 20px;
		font-size: 20px;
		color: #9B9B9B;
		margin-top: -25px;
		
	}


.shuzi2{
		float: right;
		line-height: 20px;
		font-size: 20px;
		color: #00C850;
		margin-top: -25px;
	}
.clearfix{float: none;
		clear: none;
		}
</style>
